""" Random number generator for G and R
would have been better if possible in Perl ...

Basile Clout, December 2007
"""

import random

Rmin=0.001
Rmax=1
Gmin=10
Gmax=10000

nmax=1000000
n=100

print "# %d %d %d %f %f" % (n, Gmin, Gmax, Rmin, Rmax)

j=0
i=0
cR=0
cG=0
while (j<n and i<nmax):
    cG=cR=0
    while(i<nmax and cG==0):
        nbG = random.lognormvariate(Gmin, 10), 1
        if nbG[0]>Gmin and nbG[0]<Gmax:
            cG=1
        i+=1
    while(i<nmax and cR==0):
        nbR = random.lognormvariate(Rmin, 10), 1
        if nbR[0]>Rmin and nbR[0]<Rmax:
            cR=1
        i+=1
    j+=1
    print "%d %.10f" % (int(nbG[0]), nbR[0])

